package com.cq.hd.member.api;

import com.alibaba.fastjson.JSONObject;
import com.cq.hd.common.pagination.Page;
import com.cq.hd.common.response.Result;
import com.cq.hd.member.api.dto.*;
import com.cq.hd.member.api.vo.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.*;

@FeignClient(value = "hd-o2o-member-service", contextId = "member-fee-config-api")
public interface TbMemberFeeConfigApi {

    // 添加
    @PostMapping("/member/memberFeeConfig/saveMemberFeeConfig")
    Result<Long> saveMemberFeeConfig(@RequestBody MemberFeeConfigSaveDto memberFeeConfigSaveDto);

    // 编辑
    @PutMapping("/member/memberFeeConfig/updateMemberFeeConfig")
    Result<Boolean> updateMemberFeeConfig(@RequestBody MemberFeeConfigUpdateDto memberFeeConfigUpdateDto);

    // 管理后台分页列表
    @GetMapping("/member/memberFeeConfig/pageMemberFeeConfig")
    Result<Page<MemberFeeConfigPageVo>> pageMemberFeeConfig(@SpringQueryMap MemberFeeConfigPageDto memberFeeConfigPageDto);

    // 商家端分页列表
    @GetMapping("/member/memberFeeConfig/pageAppMemberFeeConfig")
    Result<Page<AppMemberFeeConfigPageVo>> pageAppMemberFeeConfig(@SpringQueryMap AppMemberFeeConfigPageDto appMemberFeeConfigPageDto);

    // 创建充值订单，返回充值订单号
    @PostMapping("/member/memberFeeConfig/createAppMemberFeeConfigOrder")
    Result<String> createAppMemberFeeConfigOrder(@RequestBody AppMemberFeeConfigCreateDto appMemberFeeConfigCreateDto);

    // 立即支付，唤起第三方支付
    @PostMapping("/member/memberFeeConfig/payAppMemberFeeConfigOrder")
    Result<AppMemberFeeConfigPayVo> payAppMemberFeeConfigOrder(@RequestBody AppMemberFeeConfigPayDto appMemberFeeConfigPayDto);

    // 聚合正扫下单回调
    @PostMapping("/member/memberFeeConfig/jsPayCallback")
    Result<Boolean> jsPayCallback(@RequestBody JSONObject dataObj);

    // 查单（只要唤醒了第三方支付，关闭第三方支付页面之后，不管是成功还是失败，都要调用）
    @PostMapping("/member/memberFeeConfig/queryOrderPay")
    Result<Boolean> queryOrderPay(@RequestBody AppMemberFeePayQueryDto appMemberFeePayQueryDto);

    // 赠送会员
    @PostMapping("/member/memberFeeConfig/giveMemberFee")
    Result<Boolean> giveMemberFee(@RequestBody MemberFeeGiveDto memberFeeGiveDto);

    // 修改权益
    @PostMapping("/member/memberFeeConfig/changeRights")
    Result<Boolean> changeRights(@RequestBody MemberFeeChangeDto memberFeeChangeDto);

    // 获取会员配置详情
    @GetMapping("/member/memberFeeConfig/detailById")
    Result<MemberFeeConfigPageVo> detailById(@RequestParam("id") Long id);

    // 网银支付开通会员
    @PostMapping("/member/memberFeeConfig/bankPayAdminMemberFeeConfigOrder")
    Result<BankPayRechargeVo> bankPayAdminMemberFeeConfigOrder(@RequestBody AdminBusinessMemberFeePayDto adminBusinessMemberFeePayDto);

    // 网银支付查单
    @PostMapping("/member/memberFeeConfig/queryBankPayOrder")
    Result<BankPayQueryVo> queryBankPayOrder(@RequestBody BankPayQueryDto bankPayQueryDto);

    // 网银开通会员回调
    @PostMapping("/member/memberFeeConfig/bankPayCallback")
    Result<Boolean> bankPayCallback(@RequestBody JSONObject dataObj);
}
